//
//  TaskDetailTableViewCell.m
//  MobileOffice
//
//  Created by jjkj on 16/11/21.
//  Copyright © 2016年 liaoningjujin. All rights reserved.
//

#import "TaskDetailTableViewCell.h"

@implementation TaskDetailTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.contentView.backgroundColor=[UIColor clearColor];
        self.backgroundColor=[UIColor clearColor];
        
        _timeLabel=[MyControl creatLabelWithFrame:CGRectMake(8, 18, 80, 40) text:@""];
        _timeLabel.font=FONT_13;
        _timeLabel.numberOfLines=0;
        _timeLabel.textAlignment=NSTextAlignmentCenter;
        [self.contentView addSubview:_timeLabel];
        
        _lineLabel=[MyControl creatLabelWithFrame:CGRectMake(_timeLabel.x+_timeLabel.width+8, 0, 1, 186) text:@""];
        _lineLabel.backgroundColor=[UIColor lightGrayColor];
        [self.contentView addSubview:_lineLabel];
        
        _planEndTimeSignLabel=[MyControl creatLabelWithFrame:CGRectMake(_timeLabel.x+_timeLabel.width, 18, 16, 2) text:@""];
        _planEndTimeSignLabel.backgroundColor=COLOR_PINK;
        _planEndTimeSignLabel.hidden=YES;
        [self.contentView addSubview:_planEndTimeSignLabel];
        
        _planEndTimeLabel=[MyControl creatLabelWithFrame:CGRectMake(_lineLabel.x+_lineLabel.width+15, 8, IPHONE_WIDTH-(_lineLabel.x+_lineLabel.width+15)-8, 20) text:@""];
        _planEndTimeLabel.font=FONT_12;
        _planEndTimeLabel.hidden=YES;
        _planEndTimeLabel.textColor=[UIColor lightGrayColor];
        [self.contentView addSubview:_planEndTimeLabel];
        
        _stateImageView=[MyControl creatImageViewWithFrame:CGRectMake(_timeLabel.x+_timeLabel.width, 28, 16, 16) imageName:@"checkbox_normal@2x"];
        [self.contentView addSubview:_stateImageView];
        
        self.signImageView=[[UIImageView alloc]initWithFrame:CGRectMake(_stateImageView.x+_stateImageView.width-1, 31, 10, 10)];
        self.signImageView.image=[UIImage imageNamed:@"k_jantou_red@2x"];
        self.signImageView.hidden=YES;
        [self.contentView addSubview:self.signImageView];
        
        _openButton=[UIButton buttonWithType:UIButtonTypeCustom];
        _openButton.frame=CGRectMake(IPHONE_WIDTH-58, 18, 50, 30);
        [_openButton setTitle:@"展开" forState:UIControlStateNormal];
        [_openButton setTitle:@"收起" forState:UIControlStateSelected];
        [_openButton setTitleColor:COLOR_MIDBLUE forState:UIControlStateNormal];
        [_openButton setTitleColor:COLOR_MIDBLUE forState:UIControlStateSelected];
        _openButton.titleLabel.font=[UIFont systemFontOfSize:14];
        [self.contentView addSubview:_openButton];
        
        _nameLabel=[MyControl creatLabelWithFrame:CGRectMake(_lineLabel.x+_lineLabel.width+15, 28, 70, 15) text:@""];
        _nameLabel.font=FONT_14;
        [self.contentView addSubview:_nameLabel];
        
        _holidayTypeLabel=[MyControl creatLabelWithFrame:CGRectMake(_nameLabel.x+_nameLabel.width, _nameLabel.y+2, 60, 13) text:@""];
        _holidayTypeLabel.font=FONT_12;
        _holidayTypeLabel.textColor=[UIColor lightGrayColor];
        [self.contentView addSubview:_holidayTypeLabel];
        
        _beginTimeLabel=[MyControl creatLabelWithFrame:CGRectMake(_nameLabel.x, _nameLabel.y+_nameLabel.height+5, IPHONE_WIDTH-(_lineLabel.x+_lineLabel.width+15)-8, 20) text:@""];
        _beginTimeLabel.font=FONT_12;
        _beginTimeLabel.textColor=[UIColor grayColor];
        [self.contentView addSubview:_beginTimeLabel];
        
        _endTimeLabel=[MyControl creatLabelWithFrame:CGRectMake(_nameLabel.x, _beginTimeLabel.y+_beginTimeLabel.height, _beginTimeLabel.width, 20) text:@""];
        _endTimeLabel.font=FONT_12;
        _endTimeLabel.textColor=[UIColor grayColor];
        [self.contentView addSubview:_endTimeLabel];
        
        _reasonLabel=[MyControl creatLabelWithFrame:CGRectMake(_nameLabel.x, _endTimeLabel.y+_endTimeLabel.height, _beginTimeLabel.width, 20) text:@""];
        _reasonLabel.font=FONT_12;
        _reasonLabel.textColor=[UIColor grayColor];
        [self.contentView addSubview:_reasonLabel];
        
//        _endTimeLabel=[MyControl creatLabelWithFrame:CGRectMake(_nameLabel.x, _beginTimeLabel.y+_beginTimeLabel.height, _beginTimeLabel.width, 20) text:@"开始时间："];
//        _endTimeLabel.font=FONT_12;
//        _endTimeLabel.textColor=[UIColor grayColor];
//        [self.contentView addSubview:_endTimeLabel];
        
        _businessCountLabel=[MyControl creatLabelWithFrame:CGRectMake(_nameLabel.x, _reasonLabel.y+_reasonLabel.height, _beginTimeLabel.width, 20) text:@""];
        _businessCountLabel.font=FONT_12;
        _businessCountLabel.textColor=[UIColor grayColor];
        [self.contentView addSubview:_businessCountLabel];
        
        _holidayCountLabel=[MyControl creatLabelWithFrame:CGRectMake(_nameLabel.x, _businessCountLabel.y+_businessCountLabel.height, _beginTimeLabel.width, 20) text:@""];
        _holidayCountLabel.font=FONT_12;
        _holidayCountLabel.textColor=[UIColor grayColor];
        [self.contentView addSubview:_holidayCountLabel];
        
        _yearHolidayLabel=[MyControl creatLabelWithFrame:CGRectMake(_nameLabel.x, _holidayCountLabel.y+_holidayCountLabel.height, _beginTimeLabel.width, 20) text:@""];
        _yearHolidayLabel.font=FONT_12;
        _yearHolidayLabel.textColor=[UIColor grayColor];
        [self.contentView addSubview:_yearHolidayLabel];

    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
